#ifndef __CRC16_H
#define __CRC16_H

#include <stdint.h>

uint16_t ctrl_crc16(uint8_t *ptr, uint16_t len);

#define ctrl_crc16_init(high, low)   (high) = 0xff, (low) = 0xff;
void ctrl_crc16_partition(uint8_t *p_high, uint8_t *p_low, uint8_t data);
#define ctrl_crc16_result(high, low) ((uint16_t)(high) << 8 | (low))

#endif /* !__CRC16_H */
